/**
 * api方法整合
 * @author 阿逼
 * @data 2020-08-03
 */

import request from './../utils/request'
export default {
  /** 登录 */
  login(params) {
    return request({
      url: '/users/login',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取用户列表 */
  getUserList(params) {
    return request({
      url: '/users/list',
      method: 'get',
      data: params,
      mock: false,
    })
  },
  /** 获取全部用户列表 */
  getAllUserList() {
    return request({
      url: '/users/all/list',
      method: 'get',
      data: {},
      mock: false,
    })
  },
  /** 删除用户 */
  deleteUser(params) {
    return request({
      url: '/users/delete',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 用户提交 */
  userSubmit(params) {
    return request({
      url: '/users/operate',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取菜单列表 */
  getMenuList(params) {
    return request({
      url: '/menu/list',
      method: 'get',
      data: params,
      mock: false,
    })
  },
  /** 获取角色列表对应菜单 */
  getPermissionList() {
    return request({
      url: '/users/getroleList',
      method: 'get',
      data: {},
      mock: false,
    })
  },
  /** 菜单提交 */
  menuSubmit(params) {
    return request({
      url: '/menu/operate',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取权限列表 */
  getAllRoleList() {
    return request({
      url: '/roles/allList',
      method: 'get',
      data: {},
      mock: false,
    })
  },
  /** 获取角色列表 */
  getRoleList(params) {
    return request({
      url: '/roles/list',
      method: 'get',
      data: params,
      mock: false,
    })
  },
  /** 角色列表提交 */
  roleSubmit(params) {
    return request({
      url: '/roles/operate',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取权限 */
  persionSubmit(params) {
    return request({
      url: '/roles/update/persion',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取部门列表 */
  getDeptList() {
    return request({
      url: '/dept/list',
      method: 'get',
      data: {},
      mock: false,
    })
  },
  /** 部门提交 */
  deptSubmit(params) {
    return request({
      url: '/dept/operate',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取休假列表 */
  getLeaveList(params) {
    return request({
      url: '/leave/list',
      method: 'get',
      data: params,
      mock: false,
    })
  },
  /** 休假提交 */
  leaveSubmit(params) {
    return request({
      url: 'leave/operate',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 审批 */
  leaveApprove(params) {
    return request({
      url: 'leave/approve',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取审批通知 */
  getNotify() {
    return request({
      url: '/leave/count',
      method: 'get',
      data: {},
      mock: false,
    })
  },
  /** 获取单量 */
  getSingleList(params) {
    return request({
      url: '/single/list',
      method: 'get',
      data: params,
      mock: false,
    })
  },
  /** 获取单量 */
  submitUpdateSingle(params) {
    return request({
      url: '/single/update',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取店铺公式列表 */
  getDeptListFormlua(params) {
    return request({
      url: '/single/deptList',
      method: 'get',
      data: params,
      mock: false,
    })
  },
  /** 提交添加公式 */
  handlleSubmitAdd(params) {
    return request({
      url: '/single/deptAdd',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 删除公式 */
  deleteDeptDelete(params) {
    return request({
      url: '/single/deptDel',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 更新 */
  updateDeptData(params) {
    return request({
      url: '/single/deptUpdate',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 删除 */
  submitDeleteSingle(params) {
    return request({
      url: '/single/delete',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 提交更新 */
  submitChangeSingle(params) {
    return request({
      url: '/single/change',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取全部 */
  getAllgeSingle() {
    return request({
      url: '/single/allList',
      method: 'get',
      data: {},
      mock: false,
    })
  },
  /** 提交加单 */
  submiteAddCreateSing(params) {
    return request({
      url: '/single/createSingle',
      method: 'post',
      data: params,
      mock: false,
    })
  },
  /** 获取日志接口 */
  getLogsData(params) {
    return request({
      url: '/logs/list',
      method: 'get',
      data: params,
      mock: false,
    })
  },
  /** 清空日志 */
  submitDeleteLogs() {
    return request({
      url: '/logs/deleteAll',
      method: 'get',
      data: {},
      mock: false,
    })
  },
}
